﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CoveSmushbox.Info
{
    
    public class Message
    {
        public long message_id { get; set; }
        public string number { get; set; }
        public long phone_id { get; set; }
        public string message { get; set; }
        public string format_notbefore { get; set; }
        public string format_time { get; set; }
        public string format_sent { get; set; }
        private int read { get; set; }
        public bool is_read
        {
            get
            {
                return read != 0;
            }
            set
            {
                if (value)
                {
                    read = 1;
                }
                else
                {
                    read = 0;
                }
            }
        }

        public override string ToString()
        {
            if (number != null && message != null)
            {
                return string.Format("{0}: [{1}] {2} - {3}", message_id, format_time, number, message);
            }
            else
            {
                return base.ToString();
            }
        }
    }
}
